﻿#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
#endregion

namespace TheSpirit
{
    public class CardInfo
    {
        #region Declaration

        Texture2D FireBall;
        Texture2D WaterBall;
        Texture2D Grass;

        Rectangle infoRect;

        Dictionary<String, Texture2D> CardTexture;
        String name;

        #endregion


        #region Property

        #endregion


        #region Initialize

        public CardInfo()
        {
            CardTexture = new Dictionary<string, Texture2D>();
        }

        public void LoadContent(ContentManager content)
        {
            FireBall = content.Load<Texture2D>("Strategy/CardInfo/FireBall");
            WaterBall = content.Load<Texture2D>("Strategy/CardInfo/WaterBall");
            Grass = content.Load<Texture2D>("Strategy/CardInfo/Grass");

            int x = Constants.WIDTH * 920 / 1280;
            int y = Constants.HEIGHT * 30 / 720;
            int w = FireBall.Width;
            int h = FireBall.Height;

            infoRect = new Rectangle(x, y, w, h);

            CardTexture.Add("FireBall", FireBall);
            CardTexture.Add("WaterBall", WaterBall);
            CardTexture.Add("Grass", Grass);
        }

        #endregion


        #region Update & Draw

        public void Update(String name)
        {
            this.name = name;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(CardTexture[name], infoRect, Color.White);
        }

        #endregion
    }
}
